package com.tyc;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * 类描述
 *
 * @author tyc
 * @version 1.0
 * @date 2023-01-17 10:23:06
 */

public class TestCpu {
    private static   LinkedBlockingQueue<Object> queue = new LinkedBlockingQueue<>();

    public static void main(String[] args) {
        test();
    }

    public static void test(){
        new Thread(()->{
            while (true){
                try {
                    System.out.println(queue.poll(3, TimeUnit.SECONDS));
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
